﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace FallenValkyrie {
    class Credits {

        private SpriteFont font;

        private Vector2[] fontPos = new Vector2[20];
        private int screenWidth;
        private int screenHeight;

        public Credits(SpriteFont font, int screenWidth, int screenHeight) {
            this.font = font;
            this.screenHeight = screenHeight;
            this.screenWidth = screenWidth;
            for (int i =0 ; i < 20; i++) {
                fontPos[i] = new Vector2(500, 500 + i * 80);
            }

        }

        public void scrollCredits(SpriteBatch sb, Texture2D scrollingBackground, float scrollSpeed, Color color) {
            sb.Begin();
            sb.Draw(scrollingBackground, new Rectangle(0, 0, screenWidth, screenHeight), Color.White);
                sb.DrawString(font, "Fallen Valkyrie           ", fontPos[0] -= new Vector2(0, scrollSpeed), color, 0, Vector2.Zero, 3, SpriteEffects.None, 1);
                sb.DrawString(font, " Programmers             ", fontPos[1] -= new Vector2(0, scrollSpeed), color, 0, Vector2.Zero, 2, SpriteEffects.None, 1);
                sb.DrawString(font, "      Chew Yu Szen             ", fontPos[2] -= new Vector2(0, scrollSpeed), color);
                sb.DrawString(font, "      Lim Chow Siang           ", fontPos[3] -= new Vector2(0, scrollSpeed), color);
                sb.DrawString(font, "      Lee Royce Lynn           ", fontPos[4] -= new Vector2(0, scrollSpeed), color);
                sb.DrawString(font, "      Khong Mun Wei            ", fontPos[5] -= new Vector2(0, scrollSpeed), color);
                sb.DrawString(font, "   Artists                 ", fontPos[6] -= new Vector2(0, scrollSpeed), color, 0, Vector2.Zero, 2, SpriteEffects.None, 1);
                sb.DrawString(font, "         Lip Hau                 ", fontPos[7] -= new Vector2(0, scrollSpeed), color);
                sb.DrawString(font, "( Friend of Chow Siang's )     ", fontPos[8] -= new Vector2(0, scrollSpeed), color);
                sb.DrawString(font, "      Chew Yu Szen              ", fontPos[9] -= new Vector2(0, scrollSpeed), color);
                sb.DrawString(font, "by ATK / Arrow in the k**e                ", fontPos[10] -= new Vector2(0, scrollSpeed), color, 0, Vector2.Zero, 2, SpriteEffects.None, 1);
            

            sb.End();
        }

    }
}
